home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / C / Applications / Tcl-Tk 8.0 / Pre-installed version / tk8.0 / tests / cmds.test < prev    next >
Encoding:
Text File  |  1997-08-15  |  1.5 KB  |  44 lines  |  [TEXT/ALFA]

  1. # This file is a Tcl script to test the procedures in the file
  2. # tkCmds.c.  It is organized in the standard fashion for Tcl tests.
  3. #
  4. # Copyright (c) 1996 Sun Microsystems, Inc.
  5. #
  6. # See the file "license.terms" for information on usage and redistribution
  7. # of this file, and for a DISCLAIMER OF ALL WARRANTIES.
  8. #
  9. # SCCS: @(#) cmds.test 1.1 96/03/14 13:25:24
  10.  
  11. if {[string compare test [info procs test]] == 1} {
  12.     source defs
  13. }
  14.  
  15. eval destroy [winfo child .]
  16. wm geometry . {}
  17. update
  18.  
  19. test cmds-1.1 {tkwait visibility, argument errors} {
  20.     list [catch {tkwait visibility} msg] $msg
  21. } {1 {wrong # args: should be "tkwait variable|visibility|window name"}}
  22. test cmds-1.2 {tkwait visibility, argument errors} {
  23.     list [catch {tkwait visibility foo bar} msg] $msg
  24. } {1 {wrong # args: should be "tkwait variable|visibility|window name"}}
  25. test cmds-1.3 {tkwait visibility, argument errors} {
  26.     list [catch {tkwait visibility bad_window} msg] $msg
  27. } {1 {bad window path name "bad_window"}}
  28. test cmds-1.4 {tkwait visibility, waiting for window to be mapped} {
  29.     button .b -text "Test"
  30.     set x init
  31.     after 100 {set x delay; place .b -x 0 -y 0}
  32.     tkwait visibility .b
  33.     destroy .b
  34.     set x
  35. } {delay}
  36. test cmds-1.5 {tkwait visibility, window gets deleted} {
  37.     frame .f
  38.     button .f.b -text "Test"
  39.     pack .f.b
  40.     set x init
  41.     after 100 {set x deleted; destroy .f}
  42.     list [catch {tkwait visibility .f.b} msg] $msg $x
  43. } {1 {window ".f.b" was deleted before its visibility changed} deleted}
  44.